package com.lanou.mapper;

import com.lanou.bean.AdminInfo;
import com.lanou.bean.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
@Repository
public interface AdminInfoMapper {

    AdminInfo selectlogin(@Param("username") String username, @Param("password") String password);

    List<AdminInfo> selectRole(@Param("username") String username);

    List<AdminInfo> selectAll();

    void addAdmin(AdminInfo adminInfo);
    void addRoles(@Param("adminId")Integer adminId,@Param("roleId") Integer roleId);

    void updaAdmin(@Param("admincode") String admincode,@Param("name") String name,@Param("telephone") String telephone,@Param("email") String email,@Param("adminId") Integer adminId);

    void delete(Integer adminId);
    List<AdminInfo> selectAdminRoleByName(String username);

    void updateUserInfo(@Param("name") String name,@Param("telephone") String telephone,@Param("email") String email,@Param("adminCode") String adminCode);

    List<AdminInfo> selectOldPasswordExist(@Param("password") String password,@Param("adminCode") String adminCode);

    void updatePassword(@Param("password") String password,@Param("adminCode") String adminCode);

    void resetpassById(Integer integer);
}